"""
	修改Demo01_3.py 使用方法来写
"""

def write_to_file(path,content):
    """
        将content写入path所代表的文件中
    """
    with open(file = path,mode='x', encoding="UTF-8") as file:
        file.write(content)
    

def read_from_file(path):
    """
        将path所对应的文件中内容读取出来
    """
    with open(file = path,mode='r', encoding="UTF-8") as file:
        content = file.readlines()
        st = ""
        for line in content:
            st += line
    return st
    
     
write_to_file(r"D:\C.txt","Hello") 
write_to_file(r"D:\D.txt","World") 
content = read_from_file(r'D:\C.txt') + read_from_file(r'D:\D.txt')    
write_to_file(r"D:\E.txt",content) 
    
   